/**
 * 
 */
package com.sinosoft.perfect.system._roleBusiness.dao;

import java.sql.SQLException;
import java.util.List;

import com.sinosoft.perfect.common.system.BaseSqlSessionDaoSupport;
import com.sinosoft.perfect.system._.po.TRoleBusiness;
import com.sinosoft.perfect.system._roleBusiness.MapperSystemRoleBusiness;
import com.sinosoft.perfect.system._roleBusiness.vo.AllUsersInOneRoleBusinessVO;
import com.sinosoft.perfect.system._roleBusiness.vo.RoleBusinessVO;

/**
 * @author gaoyan
 * 
 */
public class RoleBusinessDAOImpl extends BaseSqlSessionDaoSupport implements IRoleBusinessDAO {

	private MapperSystemRoleBusiness getMapperSystemRoleBusiness() {
		return getSqlSession().getMapper(MapperSystemRoleBusiness.class);
	}

	public int deleteTRoleBusinessByPrimaryKey(TRoleBusiness troleBusiness) throws SQLException {
		return getMapperSystemRoleBusiness().deleteTRoleBusinessByPrimaryKey(troleBusiness);
	}

	public int deleteTRoleBusinessUserByRoleBusinessPrimaryKey(TRoleBusiness troleBusiness) throws SQLException {
		return getMapperSystemRoleBusiness().deleteTRoleBusinessUserByRoleBusinessPrimaryKey(troleBusiness);
	}

	public Object insertByTRoleBusiness(TRoleBusiness troleBusiness) throws SQLException {
		return getMapperSystemRoleBusiness().insertByTRoleBusiness(troleBusiness);
	}

	public List<TRoleBusiness> selectByTRoleBusiness(TRoleBusiness troleBusiness, int startIndex, int endIndex) throws SQLException {
		return getMapperSystemRoleBusiness().selectByTRoleBusiness(troleBusiness, startIndex, endIndex);
	}

	public List<TRoleBusiness> selectByTRoleBusiness(TRoleBusiness troleBusiness) throws SQLException {
		return getMapperSystemRoleBusiness().selectByTRoleBusiness(troleBusiness);
	}

	public List<RoleBusinessVO> selectTRoleBusinessFromUnit(String unitId) throws SQLException {
		return getMapperSystemRoleBusiness().selectTRoleBusinessFromUnit(unitId);
	}

	public List<RoleBusinessVO> selectTRoleBusinessFromUser(String userId) throws SQLException {
		return getMapperSystemRoleBusiness().selectTRoleBusinessFromUser(userId);
	}

	public int updateTRoleBusinessByPrimaryKey(TRoleBusiness troleBusiness) throws SQLException {
		return getMapperSystemRoleBusiness().updateTRoleBusinessByPrimaryKey(troleBusiness);
	}

	public int updateTRoleBusinessNotNullByPrimaryKey(TRoleBusiness troleBusiness) throws SQLException {
		return getMapperSystemRoleBusiness().updateTRoleBusinessNotNullByPrimaryKey(troleBusiness);
	}

	public Object selectTRoleBusinessSortNum(String roleBusinessId) throws SQLException {
		return getMapperSystemRoleBusiness().selectTRoleBusinessSortNum(roleBusinessId);
	}

	public Object selectTRoleBusinessMAXSortNum() throws SQLException {
		return getMapperSystemRoleBusiness().selectTRoleBusinessMAXSortNum();
	}

	@Override
	public List<AllUsersInOneRoleBusinessVO> selectExitsUsers(TRoleBusiness tRoleBusiness) throws SQLException {
		return getMapperSystemRoleBusiness().selectExitsUsers(tRoleBusiness);
	}

}
